#include <stdio.h>
#include <fcntl.h>
#include <sys/ioctl.h>
#include "led_app.h"


int main(int argc, const char *argv[])
{
	int i = 0;
	int fd = -1;
	int ret = -1;

	fd = open("/dev/led",O_RDWR);
	if(fd < 0)
	{
		perror("led open fail!\n");
		return -1;
	}

	while(1)
	{
		for(i = 0;i < 4;i++)
		{
			ret = ioctl(fd, _IO(i, 0));
			ret = ioctl(fd, _IO((i + 1) % 4, 1));
			if(ret != 0)
			{
				perror("led ioctl");
			}
			sleep(1);

		}
	}

	return 0;
}
